import fetch from 'common/src/utils/fetch'


/**
 * 新增
 */
function addElcCourse(data) {
    return fetch({
        url: '/api/electionservice/elcAffinityCourses/addCourse',
        method: 'post',
        data: data
    });
}

/**
 * 删除
 */
function deleteElcCourse(data) {
    return fetch({
        url: '/api/electionservice/elcAffinityCourses/delete',
        method: 'post',
        data: data
    });
}

/**
 * 添加学生
 */
function addStudent(data) {
    return fetch({
        url: '/api/electionservice/elcAffinityCourses/addStudent',
        method: 'post',
        data: data
    });
}
/**
 * 批量添加学生
 */
// function batchAddStudent(data) {
//     return fetch({
//         url: '/api/electionservice/elcAffinityCourses/batchAddStudent',
//         method: 'post',
//         data: data
//     });
// }
/**
 * 批量添加学生
 */
function batchAddStudent(data) {
    return fetch({
        url: '/api/electionservice/elcAffinityCourses/asyncBatchAddStudent',
        method: 'post',
        data: data
    });
}

/**
 * 批量移除学生
 */
function deleteStudent(data) {
    return fetch({
        url: '/api/electionservice/elcAffinityCourses/deleteStudent',
        method: 'post',
        data: data
    });
}


/**
 * 移除所有学生
 */
function batchDeleteStudent(courseId) {
    return fetch({
        url: '/api/electionservice/elcAffinityCourses/batchDeleteStudent?teachingClassId='+courseId,
        method: 'post',
    });
}

export default {
    "addElcCourse": addElcCourse,
    "deleteElcCourse": deleteElcCourse,
    "addStudent": addStudent,
    "batchAddStudent": batchAddStudent,
    "deleteStudent": deleteStudent,
    "batchDeleteStudent": batchDeleteStudent,

    
}
